/* =============================================================================
 * cross-sectional earnings profiles (Korea)
 * ===========================================================================*/

use "data\Korea.dta", clear

drop if outlier

drop if age < 18
drop if age > 65

keep if gender == 1

recode year (1997/2000 = 1)(2001/2005 = 2)(2006/2010 = 3)(2011/2015 = 4), gen(yeargroup)
	
twoway (lpolyci rwage age if yeargroup == 1  [aw = weight], clcolor(blue) fcolor(%30) lpattern(shortdash))	///
	(lpolyci rwage age if yeargroup == 2  [aw = weight], clcolor(red) fcolor(%30) lpattern(longdash))		///
	(lpolyci rwage age if yeargroup == 3  [aw = weight], clcolor(green) fcolor(%30) lpattern(dash_dot))	///
	(lpolyci rwage age if yeargroup == 4  [aw = weight], clcolor(orange) fcolor(%30)), ///
	xlabel(20(5)65, labsize(medlarge))  ylabel(, labsize(medlarge)) 	///
	xtitle("Age", size(medlarge)) ytitle("Monthly Earnings (10k 2015 KRW)", size(medlarge))			///
	legend(order(2 "1997-2000" 4 "2001-2005" 6 "2006-2010" 8 "2011-2015") 	///
	rows(1) position(6) size(medlarge)) 

graph export "figures\kr_cross_sectional_earnings.pdf", as(pdf) replace
